package card_discount

import (
	sqlc "bp/db/sqlc"
	"bp/internal/render"
	"bp/internal/util"
	cardDiscountGrpc "bp/rpc/gen/mwebapi/mcard_discount"
	"context"
)

// VldCardDiscountByOutCardIDReq 验证获取卡折扣请求
func (s *CardDiscountMWebApiImp) VldCardDiscountByOutCardIDReq(ctx context.Context, q *sqlc.Queries, req *cardDiscountGrpc.GetCardDiscountByOutCardIDReq) (outCardId int64, err error) {
	slog := util.NewContextLogger(ctx, s.slog)
	if req.OutCardId < 0 {
		err = render.InvalidArgumentRange("out_card_id")
		return
	}
	outCardId = req.OutCardId
	slog.Infof("card_discount_imp/query_vld.VldCardDiscountByOutCardIDReq ok")
	return
}